#ifndef _AIS_FILTER_PROXY_MODEL_H_
#define _AIS_FILTER_PROXY_MODEL_H_

#include <QScriptEngine>
#include <QSortFilterProxyModel>

class ais_filter_proxy_model : public QSortFilterProxyModel
{
    Q_OBJECT

public:
    ais_filter_proxy_model(QObject * parent = 0 ) ;

public:
    void set_filter(QString filter) { filter_str = filter ; } 
    QString get_filter() const { return filter_str ; } 

protected:
    virtual bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const ; 

private:
    bool do_filter(QAbstractItemModel* srcModel,  int source_row, const QModelIndex & source_parent ) const;

private:
    QString filter_str;
    QScriptEngine *myEngine;
};

#endif